#ifndef __WINDOW_ROOMS_H__
#define __WINDOW_ROOMS_H__

#include "window.h"
#include "sdlImage.h"
#include "sdlButton.h"
#include "sdlButtonSala.h"
#include "sdlSound.h"
#include "sdlTextImage.h"
#include "sdlStringInput.h"
#include "Sala.h"
#include <vector>
#include <string>

#define MAX_SALAS_PANTALLA 7

class windowRooms: public window{
private:
	sdlImage background;
	sdlButton botBack;  
	sdlButton botNewSala;
	//sdlButton botPlayersOrd; //orden por cant jugadores
	sdlSound sndBotClick; //Sonido al hacer click en un botón
	sdlTextImage vSalasImg[MAX_SALAS_PANTALLA];
	std::vector<Sala> vSalas;
	std::vector<sdlButtonSala*> vBotsSalas;
	sdlButton botNivel;
	sdlStringInput input; //entrada para datos de nueva sala
	std::string nivelGetted;
	std::string maxPlyrsGetted;
	bool writing;
	bool waitingConf;
public:
	windowRooms(sdlScreen&);
	virtual void show();
	virtual bool handleEvent(const SDL_Event&, window*&);
	~windowRooms();
private:
	void cargarSalas();
	void cargarImgsSalas();
	void actualizarSalas();
	window* handleBotBack();
	void handleBotNewSala();
	bool handleBotSala(unsigned);
	bool handleCrearSala();
	void esperarCompleta(unsigned);
	void confirmar();
	void mostrarDialogo();
	void handleY_NConfirm(bool);
};

#endif // __WINDOW_ROOMS_H__
